package com.gcloud.configuracion;

import android.app.Activity;
import android.os.Bundle;
import com.gcloud.*;  
import com.gcloud.librerias.*;
import com.gcloud.login.LoginValidator;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.SimpleAdapter;
import com.example.gcode.*;  
import com.example.gcode.R.drawable;
public class Cuentas extends Activity{
	
	Button button1, button2, button3;
	
	private static String KEY_SUCCESS = "success";
	private static String KEY_ERROR = "error";
	private static String KEY_ERROR_MSG = "error_msg";
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.cuentas_layout);
		
		button1 = (Button) findViewById(R.id.button1);
		button2 = (Button) findViewById(R.id.button2);
		button3 = (Button) findViewById(R.id.button3);
		
		button1.setOnClickListener(new View.OnClickListener() {			
			
			@Override
			public void onClick(View view){
				String usuario = "giancarlo.greina@gmail.com";
				String clave = "12345";
				String servicio = "1";
				String users ="1";
				
				UserFunctions userFunction = new UserFunctions();
				userFunction.agregarCuenta(usuario, clave, users, servicio);
			}
		});
		
		button2.setOnClickListener(new View.OnClickListener() {			
			
			@Override
			public void onClick(View view){
				String usuario = "1";
				
				UserFunctions userFunction = new UserFunctions();
				userFunction.obtenerCuentas(usuario);
			}
		});
		
		button3.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				String id_cuenta = "1";
				
				UserFunctions userFunction = new UserFunctions();
				userFunction.eliminarCuenta(id_cuenta);
				
				
			}
		});
	}
	
	
	
}
